<?php
pfLabel::setLabelRenderer(pfRendererHTML::getInstance());

class pfLabel {

	static private $renderer;

	private $text;

	/**
	 * 
	 * @var pfField
	 */
	private $field;

	/**
	 * 
	 * @param string $label
	 * @param pfField $field
	 */
	public function __construct($text, field) {
		$this->text  = $text;
		$this->field = $field;
	}

	/**
	 * @param pfRendererLabel $renderer
	 */
	static public function setLabelRenderer(pfRendererLabel $renderer) {
		self::$renderer = $renderer;
	}

	public function getText() {
		return $this->text;
	}

	public function __toString() {
		return self::$renderer->renderLabel($this);
	}

}